# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidEnterprise.V1.Model.ProductSet do
  @moduledoc """
  A set of products.

  ## Attributes

  *   `productId` (*type:* `list(String.t)`, *default:* `nil`) - The list of product IDs making up the set of products.
  *   `productSetBehavior` (*type:* `String.t`, *default:* `nil`) - The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards compatibility. Further "allApproved" or "includeAll" does not enable automatic visibility of "alpha" or "beta" tracks for Android app. Use ProductVisibility to enable "alpha" or "beta" tracks per user.
  *   `productVisibility` (*type:* `list(GoogleApi.AndroidEnterprise.V1.Model.ProductVisibility.t)`, *default:* `nil`) - Additional list of product IDs making up the product set. Unlike the productID array, in this list It's possible to specify which tracks (alpha, beta, production) of a product are visible to the user. See ProductVisibility and its fields for more information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :productId => list(String.t()) | nil,
          :productSetBehavior => String.t() | nil,
          :productVisibility =>
            list(GoogleApi.AndroidEnterprise.V1.Model.ProductVisibility.t()) | nil
        }

  field(:productId, type: :list)
  field(:productSetBehavior)

  field(:productVisibility,
    as: GoogleApi.AndroidEnterprise.V1.Model.ProductVisibility,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.ProductSet do
  def decode(value, options) do
    GoogleApi.AndroidEnterprise.V1.Model.ProductSet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.ProductSet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
